﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace Asteroids
{
    public class Ship : SpaceItem
    {
        public Ship(int mod, Vector2 pos, Vector2 vel) : base(pos, vel)
        {
            m_model = mod;
            ItemModel model = Game1.shipModels[m_model];
            Texture2D texture = model.texture;
            m_maxThrust = model.maxSpeed;
            m_accelFactor = model.accelFactor;
            m_mass = model.mass;
            radius = model.radius;
            health = model.health;
            maxHealth = model.health;
            gold = model.gold;
            m_exp = model.exp;
            m_sprite = new AnimatedSprite(texture, 0, 0, texture.Width, texture.Height, 1);
        }

        public override void Update(GameTime gametime)
        {
            base.Update(gametime);
            m_velocity *= (1 - friction);
        }
    }
}
